/*
 * @Description: 钱包收入支出列表组件   WalletListComponent
 * @version: 
 * @Company: 
 * @Author: ZhengZhuang
 * @Date: 2019-08-30 10:52:18
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2021-07-15 09:45:25
 */
import 'dart:developer';

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:C20Driver/model/pickup_model.dart';
import 'package:C20Driver/service/request.dart';

class WalletListComponent extends StatelessWidget {
  final String direction;
  final String title;
  final String time;
  final String debitAmount;
  final String creditAmount;
  final String infoid;
  final String vouchercode;
  WalletListComponent(
      {Key key,
      this.direction,
      this.title,
      this.time,
      this.debitAmount,
      this.creditAmount,
      this.infoid,
      this.vouchercode});

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.all(ScreenUtil().setWidth(32)),
      margin: EdgeInsets.only(
          bottom: ScreenUtil().setWidth(32),
          left: ScreenUtil().setWidth(32),
          right: ScreenUtil().setWidth(32)),
      decoration: BoxDecoration(
        color: Color(0xffffffff),
        borderRadius: BorderRadius.all(
          Radius.circular(
            ScreenUtil().setWidth(32),
          ),
        ),
      ),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Text(
                '$title',
                style: TextStyle(
                  fontSize: ScreenUtil().setSp(32.0),
                  color: Color.fromARGB(255, 51, 51, 51),
                ),
              ),
              SizedBox(
                height: ScreenUtil().setWidth(10),
              ),
              Text(
                '$time',
                style: TextStyle(
                  fontSize: ScreenUtil().setSp(28.0),
                  color: Color.fromARGB(255, 153, 153, 153),
                ),
              ),
            ],
          ),
          Container(
            width: ScreenUtil().setWidth(250.0),
            height: ScreenUtil().setWidth(100.0),
            alignment: Alignment.topRight,
            child: Text(
              direction == '2' ? '+$creditAmount' : '-$debitAmount',
              style: TextStyle(
                fontSize: ScreenUtil().setSp(36.0),
                color: Colors.black54,
              ),
            ),
          ),
        ],
      ),
    );
  }
}
